import type { Model } from './model'

export type RequestConfig<T> = Partial<{
  sub: string
  paths: Array<any>
  params: RequestData
  headers: object
  data: RequestData
  typeof: typeof Model
  transform: (data: any, headers: any) => T | Promise<T>
  excludes: string[]
  includes: string[]
}>

export type RequestData = Record<string, any> | Record<string, any>[]

export type Mutable<T> = { -readonly [P in keyof T]: T[P] }

export type NonFunctionProperties<T> = Pick<T, { [K in keyof T]: T[K] extends Function ? never : K }[keyof T]>

export type ModelProperties<T> = Omit<NonFunctionProperties<T>, '$data'>

export type DataIn<T> = Mutable<Partial<ModelProperties<T>>>

export type Instance<T> = new () => T

export type Args = Array<any>
